package com.Liux.blog.controller;

import com.Liux.blog.entity.ArticleType;
import com.Liux.blog.service.ArticleTypeService;
import com.Liux.blog.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/type")
public class ArticleTypeController {


    @Autowired
    private ArticleTypeService articleTypeService;

    @PostMapping("/add")
    public ResultVo add(ArticleType articleType){
        return articleTypeService.addType(articleType);
    }
    @GetMapping("/list")
    public ResultVo list(int pageNum,int limit){
        return articleTypeService.TypeList(pageNum,limit);
    }
    @PostMapping("/update")
    public ResultVo update(ArticleType articleType){
        return articleTypeService.updateType(articleType);
    }
    @DeleteMapping("/del")
    public ResultVo del(String id){
        return articleTypeService.delType(id);
    }

}
